|
|
|
|
|
|
|
Also make a change to any existing record in this table. Notice how the 1 in the s_Generation field also changes to zero. Again, this record is marked to be synchronized. Your screen should look similar to Figure 20.14. |
|
|
|
|
|
|
|
|
Figure 20.14.
Changes to records cause the s_Generation field to be set to 0. |
|
|
|
|
|
|
|
|
Open the REPLMAST.MDB database in Visdata, and open the BookSales table. Make a change to the first record. When we perform the synchronization, notice how changes get updated in both members of the replica set. |
|
|
|
|
|
|
|
|
Now close Visdata and open the REPLDEMO.VBP project in Visual Basic 5. Add one more command button to the form. Name this button cmdSynch, and set its caption to &Synchronize. Enter the code from Listing 20.4 into the cmdSynch_Click event. |
|
|
|
|
|
|
|
|
Listing 20.4. Code to perform a bidirectional synchronization. |
|
|
|
|
|
|
|
|
Private Sub cmdSynch_Click()
Dim dbMaster As Database
'Open the database
Set dbMaster = OpenDatabase("c:\tysdbvb5\source\data\replmast.mdb")
dbMaster.Synchronize "c:\tysdbvb5\source\data\copy.mdb"
MsgBox "The synchronization is complete."
End Sub |
|
|
|
|
|